package chalmersbot;
import chalmersbot.Absyn.*;

public class PrettyPrinter
{
  //For certain applications increasing the initial size of the buffer may improve performance.
  private static final int INITIAL_BUFFER_SIZE = 128;
  //You may wish to change the parentheses used in precedence.
  private static final String _L_PAREN = new String("(");
  private static final String _R_PAREN = new String(")");
  //You may wish to change render
  private static void render(String s)
  {
    if (s.equals("{"))
    {
       buf_.append("\n");
       indent();
       buf_.append(s);
       _n_ = _n_ + 2;
       buf_.append("\n");
       indent();
    }
    else if (s.equals("(") || s.equals("["))
       buf_.append(s);
    else if (s.equals(")") || s.equals("]"))
    {
       backup();
       buf_.append(s);
       buf_.append(" ");
    }
    else if (s.equals("}"))
    {
       _n_ = _n_ - 2;
       backup();
       backup();
       buf_.append(s);
       buf_.append("\n");
       indent();
    }
    else if (s.equals(","))
    {
       backup();
       buf_.append(s);
       buf_.append(" ");
    }
    else if (s.equals(";"))
    {
       backup();
       buf_.append(s);
       buf_.append("\n");
       indent();
    }
    else if (s.equals("")) return;
    else
    {
       buf_.append(s);
       buf_.append(" ");
    }
  }


  //  print and show methods are defined for each category.
  public static String print(chalmersbot.Absyn.Sentence foo)
  {
    pp(foo, 0);
    trim();
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String show(chalmersbot.Absyn.Sentence foo)
  {
    sh(foo);
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String print(chalmersbot.Absyn.QPhrase foo)
  {
    pp(foo, 0);
    trim();
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String show(chalmersbot.Absyn.QPhrase foo)
  {
    sh(foo);
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String print(chalmersbot.Absyn.Phrase foo)
  {
    pp(foo, 0);
    trim();
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String show(chalmersbot.Absyn.Phrase foo)
  {
    sh(foo);
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String print(chalmersbot.Absyn.AuxVerb foo)
  {
    pp(foo, 0);
    trim();
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String show(chalmersbot.Absyn.AuxVerb foo)
  {
    sh(foo);
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String print(chalmersbot.Absyn.IsVrb foo)
  {
    pp(foo, 0);
    trim();
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String show(chalmersbot.Absyn.IsVrb foo)
  {
    sh(foo);
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String print(chalmersbot.Absyn.Vrb foo)
  {
    pp(foo, 0);
    trim();
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String show(chalmersbot.Absyn.Vrb foo)
  {
    sh(foo);
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String print(chalmersbot.Absyn.ToWrd foo)
  {
    pp(foo, 0);
    trim();
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String show(chalmersbot.Absyn.ToWrd foo)
  {
    sh(foo);
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String print(chalmersbot.Absyn.GoingWrd foo)
  {
    pp(foo, 0);
    trim();
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String show(chalmersbot.Absyn.GoingWrd foo)
  {
    sh(foo);
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String print(chalmersbot.Absyn.Verb foo)
  {
    pp(foo, 0);
    trim();
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String show(chalmersbot.Absyn.Verb foo)
  {
    sh(foo);
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String print(chalmersbot.Absyn.InWrd foo)
  {
    pp(foo, 0);
    trim();
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String show(chalmersbot.Absyn.InWrd foo)
  {
    sh(foo);
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String print(chalmersbot.Absyn.Preposition foo)
  {
    pp(foo, 0);
    trim();
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String show(chalmersbot.Absyn.Preposition foo)
  {
    sh(foo);
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String print(chalmersbot.Absyn.NumberRule foo)
  {
    pp(foo, 0);
    trim();
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String show(chalmersbot.Absyn.NumberRule foo)
  {
    sh(foo);
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String print(chalmersbot.Absyn.Adjective foo)
  {
    pp(foo, 0);
    trim();
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String show(chalmersbot.Absyn.Adjective foo)
  {
    sh(foo);
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String print(chalmersbot.Absyn.ManyWrd foo)
  {
    pp(foo, 0);
    trim();
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String show(chalmersbot.Absyn.ManyWrd foo)
  {
    sh(foo);
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String print(chalmersbot.Absyn.SpecialWordToken foo)
  {
    pp(foo, 0);
    trim();
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String show(chalmersbot.Absyn.SpecialWordToken foo)
  {
    sh(foo);
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String print(chalmersbot.Absyn.NameRule foo)
  {
    pp(foo, 0);
    trim();
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String show(chalmersbot.Absyn.NameRule foo)
  {
    sh(foo);
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String print(chalmersbot.Absyn.CodeRule foo)
  {
    pp(foo, 0);
    trim();
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String show(chalmersbot.Absyn.CodeRule foo)
  {
    sh(foo);
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String print(chalmersbot.Absyn.QWInW foo)
  {
    pp(foo, 0);
    trim();
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String show(chalmersbot.Absyn.QWInW foo)
  {
    sh(foo);
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String print(chalmersbot.Absyn.QWHow foo)
  {
    pp(foo, 0);
    trim();
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String show(chalmersbot.Absyn.QWHow foo)
  {
    sh(foo);
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String print(chalmersbot.Absyn.QWord foo)
  {
    pp(foo, 0);
    trim();
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String show(chalmersbot.Absyn.QWord foo)
  {
    sh(foo);
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String print(chalmersbot.Absyn.Subject foo)
  {
    pp(foo, 0);
    trim();
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String show(chalmersbot.Absyn.Subject foo)
  {
    sh(foo);
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String print(chalmersbot.Absyn.SubjectLst foo)
  {
    pp(foo, 0);
    trim();
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String show(chalmersbot.Absyn.SubjectLst foo)
  {
    sh(foo);
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String print(chalmersbot.Absyn.SubjectWrd foo)
  {
    pp(foo, 0);
    trim();
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String show(chalmersbot.Absyn.SubjectWrd foo)
  {
    sh(foo);
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String print(chalmersbot.Absyn.Rest foo)
  {
    pp(foo, 0);
    trim();
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  public static String show(chalmersbot.Absyn.Rest foo)
  {
    sh(foo);
    String temp = buf_.toString();
    buf_.delete(0,buf_.length());
    return temp;
  }
  /***   You shouldn't need to change anything beyond this point.   ***/

  private static void pp(chalmersbot.Absyn.Sentence foo, int _i_)
  {
    if (foo instanceof chalmersbot.Absyn.QSentence)
    {
       chalmersbot.Absyn.QSentence _qsentence = (chalmersbot.Absyn.QSentence) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qsentence.qphrase_, 0);
       render("?");
       if (_i_ > 0) render(_R_PAREN);
    }
  }

  private static void pp(chalmersbot.Absyn.QPhrase foo, int _i_)
  {
    if (foo instanceof chalmersbot.Absyn.QPhraseSimple)
    {
       chalmersbot.Absyn.QPhraseSimple _qphrasesimple = (chalmersbot.Absyn.QPhraseSimple) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qphrasesimple.phrase_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
  }

  private static void pp(chalmersbot.Absyn.Phrase foo, int _i_)
  {
    if (foo instanceof chalmersbot.Absyn.QYesNoAux)
    {
       chalmersbot.Absyn.QYesNoAux _qyesnoaux = (chalmersbot.Absyn.QYesNoAux) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qyesnoaux.verb_1, 0);
       pp(_qyesnoaux.subject_, 0);
       pp(_qyesnoaux.verb_2, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.QYesNoIs)
    {
       chalmersbot.Absyn.QYesNoIs _qyesnois = (chalmersbot.Absyn.QYesNoIs) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qyesnois.isvrb_, 0);
       pp(_qyesnois.subject_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.QWordIsSub)
    {
       chalmersbot.Absyn.QWordIsSub _qwordissub = (chalmersbot.Absyn.QWordIsSub) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qwordissub.qword_, 0);
       pp(_qwordissub.isvrb_, 0);
       pp(_qwordissub.subject_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.QWordIsSubVerb)
    {
       chalmersbot.Absyn.QWordIsSubVerb _qwordissubverb = (chalmersbot.Absyn.QWordIsSubVerb) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qwordissubverb.qword_, 0);
       pp(_qwordissubverb.isvrb_, 0);
       pp(_qwordissubverb.subject_, 0);
       pp(_qwordissubverb.verb_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.QWordIsSubVerbPreSub)
    {
       chalmersbot.Absyn.QWordIsSubVerbPreSub _qwordissubverbpresub = (chalmersbot.Absyn.QWordIsSubVerbPreSub) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qwordissubverbpresub.qword_, 0);
       pp(_qwordissubverbpresub.isvrb_, 0);
       pp(_qwordissubverbpresub.subject_1, 0);
       pp(_qwordissubverbpresub.verb_, 0);
       pp(_qwordissubverbpresub.preposition_, 0);
       pp(_qwordissubverbpresub.subject_2, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.QWordSubVerb)
    {
       chalmersbot.Absyn.QWordSubVerb _qwordsubverb = (chalmersbot.Absyn.QWordSubVerb) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qwordsubverb.qword_, 0);
       pp(_qwordsubverb.subject_, 0);
       pp(_qwordsubverb.verb_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.QWordSubVerbSub)
    {
       chalmersbot.Absyn.QWordSubVerbSub _qwordsubverbsub = (chalmersbot.Absyn.QWordSubVerbSub) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qwordsubverbsub.qword_, 0);
       pp(_qwordsubverbsub.subject_1, 0);
       pp(_qwordsubverbsub.verb_, 0);
       pp(_qwordsubverbsub.subject_2, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.QWordSubVerbAdj)
    {
       chalmersbot.Absyn.QWordSubVerbAdj _qwordsubverbadj = (chalmersbot.Absyn.QWordSubVerbAdj) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qwordsubverbadj.qword_, 0);
       pp(_qwordsubverbadj.subject_, 0);
       pp(_qwordsubverbadj.verb_, 0);
       pp(_qwordsubverbadj.adjective_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.QWordSubVerbPreSub)
    {
       chalmersbot.Absyn.QWordSubVerbPreSub _qwordsubverbpresub = (chalmersbot.Absyn.QWordSubVerbPreSub) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qwordsubverbpresub.qword_, 0);
       pp(_qwordsubverbpresub.subject_1, 0);
       pp(_qwordsubverbpresub.verb_, 0);
       pp(_qwordsubverbpresub.preposition_, 0);
       pp(_qwordsubverbpresub.subject_2, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.QWordSubIsVerb)
    {
       chalmersbot.Absyn.QWordSubIsVerb _qwordsubisverb = (chalmersbot.Absyn.QWordSubIsVerb) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qwordsubisverb.qword_, 0);
       pp(_qwordsubisverb.subject_, 0);
       pp(_qwordsubisverb.isvrb_, 0);
       pp(_qwordsubisverb.verb_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.QWordSubIsSub)
    {
       chalmersbot.Absyn.QWordSubIsSub _qwordsubissub = (chalmersbot.Absyn.QWordSubIsSub) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qwordsubissub.qword_, 0);
       pp(_qwordsubissub.subject_1, 0);
       pp(_qwordsubissub.isvrb_, 0);
       pp(_qwordsubissub.subject_2, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.QWordSubIsSubAdjPre)
    {
       chalmersbot.Absyn.QWordSubIsSubAdjPre _qwordsubissubadjpre = (chalmersbot.Absyn.QWordSubIsSubAdjPre) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qwordsubissubadjpre.qword_, 0);
       pp(_qwordsubissubadjpre.subject_1, 0);
       pp(_qwordsubissubadjpre.isvrb_, 0);
       pp(_qwordsubissubadjpre.subject_2, 0);
       pp(_qwordsubissubadjpre.adjective_, 0);
       pp(_qwordsubissubadjpre.preposition_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.QWordVerbSub)
    {
       chalmersbot.Absyn.QWordVerbSub _qwordverbsub = (chalmersbot.Absyn.QWordVerbSub) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qwordverbsub.qword_, 0);
       pp(_qwordverbsub.verb_, 0);
       pp(_qwordverbsub.subject_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.QWordVerbSubVerb)
    {
       chalmersbot.Absyn.QWordVerbSubVerb _qwordverbsubverb = (chalmersbot.Absyn.QWordVerbSubVerb) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qwordverbsubverb.qword_, 0);
       pp(_qwordverbsubverb.verb_1, 0);
       pp(_qwordverbsubverb.subject_1, 0);
       pp(_qwordverbsubverb.verb_2, 0);
       pp(_qwordverbsubverb.preposition_, 0);
       pp(_qwordverbsubverb.subject_2, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.QInWhichSubIsSub)
    {
       chalmersbot.Absyn.QInWhichSubIsSub _qinwhichsubissub = (chalmersbot.Absyn.QInWhichSubIsSub) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qinwhichsubissub.qwinw_, 0);
       pp(_qinwhichsubissub.subject_1, 0);
       pp(_qinwhichsubissub.isvrb_, 0);
       pp(_qinwhichsubissub.subject_2, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.QInWhichSubIsSubVerbPreSub)
    {
       chalmersbot.Absyn.QInWhichSubIsSubVerbPreSub _qinwhichsubissubverbpresub = (chalmersbot.Absyn.QInWhichSubIsSubVerbPreSub) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qinwhichsubissubverbpresub.qwinw_, 0);
       pp(_qinwhichsubissubverbpresub.subject_1, 0);
       pp(_qinwhichsubissubverbpresub.isvrb_, 0);
       pp(_qinwhichsubissubverbpresub.subject_2, 0);
       pp(_qinwhichsubissubverbpresub.verb_, 0);
       pp(_qinwhichsubissubverbpresub.preposition_, 0);
       pp(_qinwhichsubissubverbpresub.subject_3, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.QInWhichSubIsSubAdj)
    {
       chalmersbot.Absyn.QInWhichSubIsSubAdj _qinwhichsubissubadj = (chalmersbot.Absyn.QInWhichSubIsSubAdj) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qinwhichsubissubadj.qwinw_, 0);
       pp(_qinwhichsubissubadj.subject_1, 0);
       pp(_qinwhichsubissubadj.isvrb_, 0);
       pp(_qinwhichsubissubadj.subject_2, 0);
       pp(_qinwhichsubissubadj.adjective_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.QHowManySubIsSubPre)
    {
       chalmersbot.Absyn.QHowManySubIsSubPre _qhowmanysubissubpre = (chalmersbot.Absyn.QHowManySubIsSubPre) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qhowmanysubissubpre.qwhow_, 0);
       pp(_qhowmanysubissubpre.subject_1, 0);
       pp(_qhowmanysubissubpre.verb_, 0);
       pp(_qhowmanysubissubpre.subject_2, 0);
       pp(_qhowmanysubissubpre.preposition_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.QHowManySubVerbSubVerb)
    {
       chalmersbot.Absyn.QHowManySubVerbSubVerb _qhowmanysubverbsubverb = (chalmersbot.Absyn.QHowManySubVerbSubVerb) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qhowmanysubverbsubverb.qwhow_, 0);
       pp(_qhowmanysubverbsubverb.subject_1, 0);
       pp(_qhowmanysubverbsubverb.verb_1, 0);
       pp(_qhowmanysubverbsubverb.subject_2, 0);
       pp(_qhowmanysubverbsubverb.verb_2, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.QHowManySubVerbPreSub)
    {
       chalmersbot.Absyn.QHowManySubVerbPreSub _qhowmanysubverbpresub = (chalmersbot.Absyn.QHowManySubVerbPreSub) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qhowmanysubverbpresub.qwhow_, 0);
       pp(_qhowmanysubverbpresub.subject_1, 0);
       pp(_qhowmanysubverbpresub.verb_, 0);
       pp(_qhowmanysubverbpresub.preposition_, 0);
       pp(_qhowmanysubverbpresub.subject_2, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.QHowManySubVerbAdjPreSub)
    {
       chalmersbot.Absyn.QHowManySubVerbAdjPreSub _qhowmanysubverbadjpresub = (chalmersbot.Absyn.QHowManySubVerbAdjPreSub) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qhowmanysubverbadjpresub.qwhow_, 0);
       pp(_qhowmanysubverbadjpresub.subject_1, 0);
       pp(_qhowmanysubverbadjpresub.verb_, 0);
       pp(_qhowmanysubverbadjpresub.adjective_, 0);
       pp(_qhowmanysubverbadjpresub.preposition_, 0);
       pp(_qhowmanysubverbadjpresub.subject_2, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
  }

  private static void pp(chalmersbot.Absyn.AuxVerb foo, int _i_)
  {
    if (foo instanceof chalmersbot.Absyn.AuxiliaryVerb)
    {
       chalmersbot.Absyn.AuxiliaryVerb _auxiliaryverb = (chalmersbot.Absyn.AuxiliaryVerb) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_auxiliaryverb.auxiliarytoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
  }

  private static void pp(chalmersbot.Absyn.IsVrb foo, int _i_)
  {
    if (foo instanceof chalmersbot.Absyn.IsVerb)
    {
       chalmersbot.Absyn.IsVerb _isverb = (chalmersbot.Absyn.IsVerb) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_isverb.istoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
  }

  private static void pp(chalmersbot.Absyn.Vrb foo, int _i_)
  {
    if (foo instanceof chalmersbot.Absyn.RegularVerb)
    {
       chalmersbot.Absyn.RegularVerb _regularverb = (chalmersbot.Absyn.RegularVerb) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_regularverb.verbtoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
  }

  private static void pp(chalmersbot.Absyn.ToWrd foo, int _i_)
  {
    if (foo instanceof chalmersbot.Absyn.ToWord)
    {
       chalmersbot.Absyn.ToWord _toword = (chalmersbot.Absyn.ToWord) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_toword.totoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
  }

  private static void pp(chalmersbot.Absyn.GoingWrd foo, int _i_)
  {
    if (foo instanceof chalmersbot.Absyn.GoingWord)
    {
       chalmersbot.Absyn.GoingWord _goingword = (chalmersbot.Absyn.GoingWord) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_goingword.goingtoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
  }

  private static void pp(chalmersbot.Absyn.Verb foo, int _i_)
  {
    if (foo instanceof chalmersbot.Absyn.VerbGoingTo)
    {
       chalmersbot.Absyn.VerbGoingTo _verbgoingto = (chalmersbot.Absyn.VerbGoingTo) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_verbgoingto.goingwrd_, 0);
       pp(_verbgoingto.towrd_, 0);
       pp(_verbgoingto.verb_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.VerbGoing)
    {
       chalmersbot.Absyn.VerbGoing _verbgoing = (chalmersbot.Absyn.VerbGoing) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_verbgoing.goingtoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.VerbTo)
    {
       chalmersbot.Absyn.VerbTo _verbto = (chalmersbot.Absyn.VerbTo) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_verbto.totoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.VerbMain)
    {
       chalmersbot.Absyn.VerbMain _verbmain = (chalmersbot.Absyn.VerbMain) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_verbmain.vrb_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.VerbAuxiliary)
    {
       chalmersbot.Absyn.VerbAuxiliary _verbauxiliary = (chalmersbot.Absyn.VerbAuxiliary) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_verbauxiliary.auxverb_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.VerbBoth)
    {
       chalmersbot.Absyn.VerbBoth _verbboth = (chalmersbot.Absyn.VerbBoth) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_verbboth.auxverb_, 0);
       pp(_verbboth.vrb_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
  }

  private static void pp(chalmersbot.Absyn.InWrd foo, int _i_)
  {
    if (foo instanceof chalmersbot.Absyn.InWord)
    {
       chalmersbot.Absyn.InWord _inword = (chalmersbot.Absyn.InWord) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_inword.intoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
  }

  private static void pp(chalmersbot.Absyn.Preposition foo, int _i_)
  {
    if (foo instanceof chalmersbot.Absyn.Prepositions)
    {
       chalmersbot.Absyn.Prepositions _prepositions = (chalmersbot.Absyn.Prepositions) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_prepositions.inwrd_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.PrepositionsTok)
    {
       chalmersbot.Absyn.PrepositionsTok _prepositionstok = (chalmersbot.Absyn.PrepositionsTok) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_prepositionstok.prepositiontoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
  }

  private static void pp(chalmersbot.Absyn.NumberRule foo, int _i_)
  {
    if (foo instanceof chalmersbot.Absyn.NumberRuleNumberDigitToken)
    {
       chalmersbot.Absyn.NumberRuleNumberDigitToken _numberrulenumberdigittoken = (chalmersbot.Absyn.NumberRuleNumberDigitToken) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_numberrulenumberdigittoken.numberdigittoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.NumberRuleNumberTextToken)
    {
       chalmersbot.Absyn.NumberRuleNumberTextToken _numberrulenumbertexttoken = (chalmersbot.Absyn.NumberRuleNumberTextToken) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_numberrulenumbertexttoken.numbertexttoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
  }

  private static void pp(chalmersbot.Absyn.Adjective foo, int _i_)
  {
    if (foo instanceof chalmersbot.Absyn.AdjectiveAdjectivesToken)
    {
       chalmersbot.Absyn.AdjectiveAdjectivesToken _adjectiveadjectivestoken = (chalmersbot.Absyn.AdjectiveAdjectivesToken) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_adjectiveadjectivestoken.adjectivestoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.AdjectiveManyWrd)
    {
       chalmersbot.Absyn.AdjectiveManyWrd _adjectivemanywrd = (chalmersbot.Absyn.AdjectiveManyWrd) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_adjectivemanywrd.manywrd_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
  }

  private static void pp(chalmersbot.Absyn.ManyWrd foo, int _i_)
  {
    if (foo instanceof chalmersbot.Absyn.ManyWord)
    {
       chalmersbot.Absyn.ManyWord _manyword = (chalmersbot.Absyn.ManyWord) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_manyword.manytoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
  }

  private static void pp(chalmersbot.Absyn.SpecialWordToken foo, int _i_)
  {
    if (foo instanceof chalmersbot.Absyn.SpecialWordTokenSNounSToken)
    {
       chalmersbot.Absyn.SpecialWordTokenSNounSToken _specialwordtokensnounstoken = (chalmersbot.Absyn.SpecialWordTokenSNounSToken) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_specialwordtokensnounstoken.snounstoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.SpecialWordTokenSNounEsToken)
    {
       chalmersbot.Absyn.SpecialWordTokenSNounEsToken _specialwordtokensnounestoken = (chalmersbot.Absyn.SpecialWordTokenSNounEsToken) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_specialwordtokensnounestoken.snounestoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
  }

  private static void pp(chalmersbot.Absyn.NameRule foo, int _i_)
  {
    if (foo instanceof chalmersbot.Absyn.NameRuleNameToken)
    {
       chalmersbot.Absyn.NameRuleNameToken _namerulenametoken = (chalmersbot.Absyn.NameRuleNameToken) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_namerulenametoken.nametoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
  }

  private static void pp(chalmersbot.Absyn.CodeRule foo, int _i_)
  {
    if (foo instanceof chalmersbot.Absyn.CodeRuleCodeToken)
    {
       chalmersbot.Absyn.CodeRuleCodeToken _coderulecodetoken = (chalmersbot.Absyn.CodeRuleCodeToken) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_coderulecodetoken.codetoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
  }

  private static void pp(chalmersbot.Absyn.QWInW foo, int _i_)
  {
    if (foo instanceof chalmersbot.Absyn.QWInWhich)
    {
       chalmersbot.Absyn.QWInWhich _qwinwhich = (chalmersbot.Absyn.QWInWhich) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qwinwhich.inwrd_, 0);
       pp(_qwinwhich.qwhichtoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
  }

  private static void pp(chalmersbot.Absyn.QWHow foo, int _i_)
  {
    if (foo instanceof chalmersbot.Absyn.QWHowMany)
    {
       chalmersbot.Absyn.QWHowMany _qwhowmany = (chalmersbot.Absyn.QWHowMany) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qwhowmany.qhowtoken_, 0);
       pp(_qwhowmany.manywrd_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
  }

  private static void pp(chalmersbot.Absyn.QWord foo, int _i_)
  {
    if (foo instanceof chalmersbot.Absyn.QWordQWordToken)
    {
       chalmersbot.Absyn.QWordQWordToken _qwordqwordtoken = (chalmersbot.Absyn.QWordQWordToken) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qwordqwordtoken.qwordtoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.QWordQWhichToken)
    {
       chalmersbot.Absyn.QWordQWhichToken _qwordqwhichtoken = (chalmersbot.Absyn.QWordQWhichToken) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qwordqwhichtoken.qwhichtoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.QWordQHowToken)
    {
       chalmersbot.Absyn.QWordQHowToken _qwordqhowtoken = (chalmersbot.Absyn.QWordQHowToken) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_qwordqhowtoken.qhowtoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
  }

  private static void pp(chalmersbot.Absyn.Subject foo, int _i_)
  {
    if (foo instanceof chalmersbot.Absyn.SubjectToList)
    {
       chalmersbot.Absyn.SubjectToList _subjecttolist = (chalmersbot.Absyn.SubjectToList) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_subjecttolist.subjectlst_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
  }

  private static void pp(chalmersbot.Absyn.SubjectLst foo, int _i_)
  {
    if (foo instanceof chalmersbot.Absyn.SubjectList)
    {
       chalmersbot.Absyn.SubjectList _subjectlist = (chalmersbot.Absyn.SubjectList) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_subjectlist.subjectlst_, 0);
       pp(_subjectlist.subjectwrd_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.SubjectListElement)
    {
       chalmersbot.Absyn.SubjectListElement _subjectlistelement = (chalmersbot.Absyn.SubjectListElement) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_subjectlistelement.subjectwrd_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
  }

  private static void pp(chalmersbot.Absyn.SubjectWrd foo, int _i_)
  {
    if (foo instanceof chalmersbot.Absyn.SubjectCode)
    {
       chalmersbot.Absyn.SubjectCode _subjectcode = (chalmersbot.Absyn.SubjectCode) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_subjectcode.coderule_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.SubjectBasic)
    {
       chalmersbot.Absyn.SubjectBasic _subjectbasic = (chalmersbot.Absyn.SubjectBasic) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_subjectbasic.subjecttoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.SubjectSpecialWord)
    {
       chalmersbot.Absyn.SubjectSpecialWord _subjectspecialword = (chalmersbot.Absyn.SubjectSpecialWord) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_subjectspecialword.specialwordtoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.SubjectDeterminant)
    {
       chalmersbot.Absyn.SubjectDeterminant _subjectdeterminant = (chalmersbot.Absyn.SubjectDeterminant) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_subjectdeterminant.determinanttoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.SubjectInWord)
    {
       chalmersbot.Absyn.SubjectInWord _subjectinword = (chalmersbot.Absyn.SubjectInWord) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_subjectinword.inwrd_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.SubjectSmallWord)
    {
       chalmersbot.Absyn.SubjectSmallWord _subjectsmallword = (chalmersbot.Absyn.SubjectSmallWord) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_subjectsmallword.smallwordtoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.SubjectPronoun)
    {
       chalmersbot.Absyn.SubjectPronoun _subjectpronoun = (chalmersbot.Absyn.SubjectPronoun) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_subjectpronoun.pronountoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.SubjectPeriod)
    {
       chalmersbot.Absyn.SubjectPeriod _subjectperiod = (chalmersbot.Absyn.SubjectPeriod) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_subjectperiod.periodtoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.SubjectPeriodNr)
    {
       chalmersbot.Absyn.SubjectPeriodNr _subjectperiodnr = (chalmersbot.Absyn.SubjectPeriodNr) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_subjectperiodnr.periodtoken_, 0);
       pp(_subjectperiodnr.numberrule_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.SubjectName)
    {
       chalmersbot.Absyn.SubjectName _subjectname = (chalmersbot.Absyn.SubjectName) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_subjectname.namerule_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
  }

  private static void pp(chalmersbot.Absyn.Rest foo, int _i_)
  {
    if (foo instanceof chalmersbot.Absyn.RestList)
    {
       chalmersbot.Absyn.RestList _restlist = (chalmersbot.Absyn.RestList) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_restlist.rest_1, 0);
       pp(_restlist.rest_2, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.RestIdent)
    {
       chalmersbot.Absyn.RestIdent _restident = (chalmersbot.Absyn.RestIdent) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_restident.ident_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.RestVerb)
    {
       chalmersbot.Absyn.RestVerb _restverb = (chalmersbot.Absyn.RestVerb) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_restverb.verb_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.RestPreposition)
    {
       chalmersbot.Absyn.RestPreposition _restpreposition = (chalmersbot.Absyn.RestPreposition) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_restpreposition.prepositiontoken_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.RestSubject)
    {
       chalmersbot.Absyn.RestSubject _restsubject = (chalmersbot.Absyn.RestSubject) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_restsubject.subject_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
    if (foo instanceof chalmersbot.Absyn.RestAdjective)
    {
       chalmersbot.Absyn.RestAdjective _restadjective = (chalmersbot.Absyn.RestAdjective) foo;
       if (_i_ > 0) render(_L_PAREN);
       pp(_restadjective.adjective_, 0);
       if (_i_ > 0) render(_R_PAREN);
    }
  }


  private static void sh(chalmersbot.Absyn.Sentence foo)
  {
    if (foo instanceof chalmersbot.Absyn.QSentence)
    {
       chalmersbot.Absyn.QSentence _qsentence = (chalmersbot.Absyn.QSentence) foo;
       render("(");
       render("QSentence");
       sh(_qsentence.qphrase_);
       render(")");
    }
  }

  private static void sh(chalmersbot.Absyn.QPhrase foo)
  {
    if (foo instanceof chalmersbot.Absyn.QPhraseSimple)
    {
       chalmersbot.Absyn.QPhraseSimple _qphrasesimple = (chalmersbot.Absyn.QPhraseSimple) foo;
       render("(");
       render("QPhraseSimple");
       sh(_qphrasesimple.phrase_);
       render(")");
    }
  }

  private static void sh(chalmersbot.Absyn.Phrase foo)
  {
    if (foo instanceof chalmersbot.Absyn.QYesNoAux)
    {
       chalmersbot.Absyn.QYesNoAux _qyesnoaux = (chalmersbot.Absyn.QYesNoAux) foo;
       render("(");
       render("QYesNoAux");
       sh(_qyesnoaux.verb_1);
       sh(_qyesnoaux.subject_);
       sh(_qyesnoaux.verb_2);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.QYesNoIs)
    {
       chalmersbot.Absyn.QYesNoIs _qyesnois = (chalmersbot.Absyn.QYesNoIs) foo;
       render("(");
       render("QYesNoIs");
       sh(_qyesnois.isvrb_);
       sh(_qyesnois.subject_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.QWordIsSub)
    {
       chalmersbot.Absyn.QWordIsSub _qwordissub = (chalmersbot.Absyn.QWordIsSub) foo;
       render("(");
       render("QWordIsSub");
       sh(_qwordissub.qword_);
       sh(_qwordissub.isvrb_);
       sh(_qwordissub.subject_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.QWordIsSubVerb)
    {
       chalmersbot.Absyn.QWordIsSubVerb _qwordissubverb = (chalmersbot.Absyn.QWordIsSubVerb) foo;
       render("(");
       render("QWordIsSubVerb");
       sh(_qwordissubverb.qword_);
       sh(_qwordissubverb.isvrb_);
       sh(_qwordissubverb.subject_);
       sh(_qwordissubverb.verb_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.QWordIsSubVerbPreSub)
    {
       chalmersbot.Absyn.QWordIsSubVerbPreSub _qwordissubverbpresub = (chalmersbot.Absyn.QWordIsSubVerbPreSub) foo;
       render("(");
       render("QWordIsSubVerbPreSub");
       sh(_qwordissubverbpresub.qword_);
       sh(_qwordissubverbpresub.isvrb_);
       sh(_qwordissubverbpresub.subject_1);
       sh(_qwordissubverbpresub.verb_);
       sh(_qwordissubverbpresub.preposition_);
       sh(_qwordissubverbpresub.subject_2);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.QWordSubVerb)
    {
       chalmersbot.Absyn.QWordSubVerb _qwordsubverb = (chalmersbot.Absyn.QWordSubVerb) foo;
       render("(");
       render("QWordSubVerb");
       sh(_qwordsubverb.qword_);
       sh(_qwordsubverb.subject_);
       sh(_qwordsubverb.verb_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.QWordSubVerbSub)
    {
       chalmersbot.Absyn.QWordSubVerbSub _qwordsubverbsub = (chalmersbot.Absyn.QWordSubVerbSub) foo;
       render("(");
       render("QWordSubVerbSub");
       sh(_qwordsubverbsub.qword_);
       sh(_qwordsubverbsub.subject_1);
       sh(_qwordsubverbsub.verb_);
       sh(_qwordsubverbsub.subject_2);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.QWordSubVerbAdj)
    {
       chalmersbot.Absyn.QWordSubVerbAdj _qwordsubverbadj = (chalmersbot.Absyn.QWordSubVerbAdj) foo;
       render("(");
       render("QWordSubVerbAdj");
       sh(_qwordsubverbadj.qword_);
       sh(_qwordsubverbadj.subject_);
       sh(_qwordsubverbadj.verb_);
       sh(_qwordsubverbadj.adjective_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.QWordSubVerbPreSub)
    {
       chalmersbot.Absyn.QWordSubVerbPreSub _qwordsubverbpresub = (chalmersbot.Absyn.QWordSubVerbPreSub) foo;
       render("(");
       render("QWordSubVerbPreSub");
       sh(_qwordsubverbpresub.qword_);
       sh(_qwordsubverbpresub.subject_1);
       sh(_qwordsubverbpresub.verb_);
       sh(_qwordsubverbpresub.preposition_);
       sh(_qwordsubverbpresub.subject_2);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.QWordSubIsVerb)
    {
       chalmersbot.Absyn.QWordSubIsVerb _qwordsubisverb = (chalmersbot.Absyn.QWordSubIsVerb) foo;
       render("(");
       render("QWordSubIsVerb");
       sh(_qwordsubisverb.qword_);
       sh(_qwordsubisverb.subject_);
       sh(_qwordsubisverb.isvrb_);
       sh(_qwordsubisverb.verb_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.QWordSubIsSub)
    {
       chalmersbot.Absyn.QWordSubIsSub _qwordsubissub = (chalmersbot.Absyn.QWordSubIsSub) foo;
       render("(");
       render("QWordSubIsSub");
       sh(_qwordsubissub.qword_);
       sh(_qwordsubissub.subject_1);
       sh(_qwordsubissub.isvrb_);
       sh(_qwordsubissub.subject_2);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.QWordSubIsSubAdjPre)
    {
       chalmersbot.Absyn.QWordSubIsSubAdjPre _qwordsubissubadjpre = (chalmersbot.Absyn.QWordSubIsSubAdjPre) foo;
       render("(");
       render("QWordSubIsSubAdjPre");
       sh(_qwordsubissubadjpre.qword_);
       sh(_qwordsubissubadjpre.subject_1);
       sh(_qwordsubissubadjpre.isvrb_);
       sh(_qwordsubissubadjpre.subject_2);
       sh(_qwordsubissubadjpre.adjective_);
       sh(_qwordsubissubadjpre.preposition_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.QWordVerbSub)
    {
       chalmersbot.Absyn.QWordVerbSub _qwordverbsub = (chalmersbot.Absyn.QWordVerbSub) foo;
       render("(");
       render("QWordVerbSub");
       sh(_qwordverbsub.qword_);
       sh(_qwordverbsub.verb_);
       sh(_qwordverbsub.subject_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.QWordVerbSubVerb)
    {
       chalmersbot.Absyn.QWordVerbSubVerb _qwordverbsubverb = (chalmersbot.Absyn.QWordVerbSubVerb) foo;
       render("(");
       render("QWordVerbSubVerb");
       sh(_qwordverbsubverb.qword_);
       sh(_qwordverbsubverb.verb_1);
       sh(_qwordverbsubverb.subject_1);
       sh(_qwordverbsubverb.verb_2);
       sh(_qwordverbsubverb.preposition_);
       sh(_qwordverbsubverb.subject_2);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.QInWhichSubIsSub)
    {
       chalmersbot.Absyn.QInWhichSubIsSub _qinwhichsubissub = (chalmersbot.Absyn.QInWhichSubIsSub) foo;
       render("(");
       render("QInWhichSubIsSub");
       sh(_qinwhichsubissub.qwinw_);
       sh(_qinwhichsubissub.subject_1);
       sh(_qinwhichsubissub.isvrb_);
       sh(_qinwhichsubissub.subject_2);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.QInWhichSubIsSubVerbPreSub)
    {
       chalmersbot.Absyn.QInWhichSubIsSubVerbPreSub _qinwhichsubissubverbpresub = (chalmersbot.Absyn.QInWhichSubIsSubVerbPreSub) foo;
       render("(");
       render("QInWhichSubIsSubVerbPreSub");
       sh(_qinwhichsubissubverbpresub.qwinw_);
       sh(_qinwhichsubissubverbpresub.subject_1);
       sh(_qinwhichsubissubverbpresub.isvrb_);
       sh(_qinwhichsubissubverbpresub.subject_2);
       sh(_qinwhichsubissubverbpresub.verb_);
       sh(_qinwhichsubissubverbpresub.preposition_);
       sh(_qinwhichsubissubverbpresub.subject_3);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.QInWhichSubIsSubAdj)
    {
       chalmersbot.Absyn.QInWhichSubIsSubAdj _qinwhichsubissubadj = (chalmersbot.Absyn.QInWhichSubIsSubAdj) foo;
       render("(");
       render("QInWhichSubIsSubAdj");
       sh(_qinwhichsubissubadj.qwinw_);
       sh(_qinwhichsubissubadj.subject_1);
       sh(_qinwhichsubissubadj.isvrb_);
       sh(_qinwhichsubissubadj.subject_2);
       sh(_qinwhichsubissubadj.adjective_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.QHowManySubIsSubPre)
    {
       chalmersbot.Absyn.QHowManySubIsSubPre _qhowmanysubissubpre = (chalmersbot.Absyn.QHowManySubIsSubPre) foo;
       render("(");
       render("QHowManySubIsSubPre");
       sh(_qhowmanysubissubpre.qwhow_);
       sh(_qhowmanysubissubpre.subject_1);
       sh(_qhowmanysubissubpre.verb_);
       sh(_qhowmanysubissubpre.subject_2);
       sh(_qhowmanysubissubpre.preposition_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.QHowManySubVerbSubVerb)
    {
       chalmersbot.Absyn.QHowManySubVerbSubVerb _qhowmanysubverbsubverb = (chalmersbot.Absyn.QHowManySubVerbSubVerb) foo;
       render("(");
       render("QHowManySubVerbSubVerb");
       sh(_qhowmanysubverbsubverb.qwhow_);
       sh(_qhowmanysubverbsubverb.subject_1);
       sh(_qhowmanysubverbsubverb.verb_1);
       sh(_qhowmanysubverbsubverb.subject_2);
       sh(_qhowmanysubverbsubverb.verb_2);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.QHowManySubVerbPreSub)
    {
       chalmersbot.Absyn.QHowManySubVerbPreSub _qhowmanysubverbpresub = (chalmersbot.Absyn.QHowManySubVerbPreSub) foo;
       render("(");
       render("QHowManySubVerbPreSub");
       sh(_qhowmanysubverbpresub.qwhow_);
       sh(_qhowmanysubverbpresub.subject_1);
       sh(_qhowmanysubverbpresub.verb_);
       sh(_qhowmanysubverbpresub.preposition_);
       sh(_qhowmanysubverbpresub.subject_2);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.QHowManySubVerbAdjPreSub)
    {
       chalmersbot.Absyn.QHowManySubVerbAdjPreSub _qhowmanysubverbadjpresub = (chalmersbot.Absyn.QHowManySubVerbAdjPreSub) foo;
       render("(");
       render("QHowManySubVerbAdjPreSub");
       sh(_qhowmanysubverbadjpresub.qwhow_);
       sh(_qhowmanysubverbadjpresub.subject_1);
       sh(_qhowmanysubverbadjpresub.verb_);
       sh(_qhowmanysubverbadjpresub.adjective_);
       sh(_qhowmanysubverbadjpresub.preposition_);
       sh(_qhowmanysubverbadjpresub.subject_2);
       render(")");
    }
  }

  private static void sh(chalmersbot.Absyn.AuxVerb foo)
  {
    if (foo instanceof chalmersbot.Absyn.AuxiliaryVerb)
    {
       chalmersbot.Absyn.AuxiliaryVerb _auxiliaryverb = (chalmersbot.Absyn.AuxiliaryVerb) foo;
       render("(");
       render("AuxiliaryVerb");
       sh(_auxiliaryverb.auxiliarytoken_);
       render(")");
    }
  }

  private static void sh(chalmersbot.Absyn.IsVrb foo)
  {
    if (foo instanceof chalmersbot.Absyn.IsVerb)
    {
       chalmersbot.Absyn.IsVerb _isverb = (chalmersbot.Absyn.IsVerb) foo;
       render("(");
       render("IsVerb");
       sh(_isverb.istoken_);
       render(")");
    }
  }

  private static void sh(chalmersbot.Absyn.Vrb foo)
  {
    if (foo instanceof chalmersbot.Absyn.RegularVerb)
    {
       chalmersbot.Absyn.RegularVerb _regularverb = (chalmersbot.Absyn.RegularVerb) foo;
       render("(");
       render("RegularVerb");
       sh(_regularverb.verbtoken_);
       render(")");
    }
  }

  private static void sh(chalmersbot.Absyn.ToWrd foo)
  {
    if (foo instanceof chalmersbot.Absyn.ToWord)
    {
       chalmersbot.Absyn.ToWord _toword = (chalmersbot.Absyn.ToWord) foo;
       render("(");
       render("ToWord");
       sh(_toword.totoken_);
       render(")");
    }
  }

  private static void sh(chalmersbot.Absyn.GoingWrd foo)
  {
    if (foo instanceof chalmersbot.Absyn.GoingWord)
    {
       chalmersbot.Absyn.GoingWord _goingword = (chalmersbot.Absyn.GoingWord) foo;
       render("(");
       render("GoingWord");
       sh(_goingword.goingtoken_);
       render(")");
    }
  }

  private static void sh(chalmersbot.Absyn.Verb foo)
  {
    if (foo instanceof chalmersbot.Absyn.VerbGoingTo)
    {
       chalmersbot.Absyn.VerbGoingTo _verbgoingto = (chalmersbot.Absyn.VerbGoingTo) foo;
       render("(");
       render("VerbGoingTo");
       sh(_verbgoingto.goingwrd_);
       sh(_verbgoingto.towrd_);
       sh(_verbgoingto.verb_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.VerbGoing)
    {
       chalmersbot.Absyn.VerbGoing _verbgoing = (chalmersbot.Absyn.VerbGoing) foo;
       render("(");
       render("VerbGoing");
       sh(_verbgoing.goingtoken_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.VerbTo)
    {
       chalmersbot.Absyn.VerbTo _verbto = (chalmersbot.Absyn.VerbTo) foo;
       render("(");
       render("VerbTo");
       sh(_verbto.totoken_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.VerbMain)
    {
       chalmersbot.Absyn.VerbMain _verbmain = (chalmersbot.Absyn.VerbMain) foo;
       render("(");
       render("VerbMain");
       sh(_verbmain.vrb_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.VerbAuxiliary)
    {
       chalmersbot.Absyn.VerbAuxiliary _verbauxiliary = (chalmersbot.Absyn.VerbAuxiliary) foo;
       render("(");
       render("VerbAuxiliary");
       sh(_verbauxiliary.auxverb_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.VerbBoth)
    {
       chalmersbot.Absyn.VerbBoth _verbboth = (chalmersbot.Absyn.VerbBoth) foo;
       render("(");
       render("VerbBoth");
       sh(_verbboth.auxverb_);
       sh(_verbboth.vrb_);
       render(")");
    }
  }

  private static void sh(chalmersbot.Absyn.InWrd foo)
  {
    if (foo instanceof chalmersbot.Absyn.InWord)
    {
       chalmersbot.Absyn.InWord _inword = (chalmersbot.Absyn.InWord) foo;
       render("(");
       render("InWord");
       sh(_inword.intoken_);
       render(")");
    }
  }

  private static void sh(chalmersbot.Absyn.Preposition foo)
  {
    if (foo instanceof chalmersbot.Absyn.Prepositions)
    {
       chalmersbot.Absyn.Prepositions _prepositions = (chalmersbot.Absyn.Prepositions) foo;
       render("(");
       render("Prepositions");
       sh(_prepositions.inwrd_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.PrepositionsTok)
    {
       chalmersbot.Absyn.PrepositionsTok _prepositionstok = (chalmersbot.Absyn.PrepositionsTok) foo;
       render("(");
       render("PrepositionsTok");
       sh(_prepositionstok.prepositiontoken_);
       render(")");
    }
  }

  private static void sh(chalmersbot.Absyn.NumberRule foo)
  {
    if (foo instanceof chalmersbot.Absyn.NumberRuleNumberDigitToken)
    {
       chalmersbot.Absyn.NumberRuleNumberDigitToken _numberrulenumberdigittoken = (chalmersbot.Absyn.NumberRuleNumberDigitToken) foo;
       render("(");
       render("NumberRuleNumberDigitToken");
       sh(_numberrulenumberdigittoken.numberdigittoken_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.NumberRuleNumberTextToken)
    {
       chalmersbot.Absyn.NumberRuleNumberTextToken _numberrulenumbertexttoken = (chalmersbot.Absyn.NumberRuleNumberTextToken) foo;
       render("(");
       render("NumberRuleNumberTextToken");
       sh(_numberrulenumbertexttoken.numbertexttoken_);
       render(")");
    }
  }

  private static void sh(chalmersbot.Absyn.Adjective foo)
  {
    if (foo instanceof chalmersbot.Absyn.AdjectiveAdjectivesToken)
    {
       chalmersbot.Absyn.AdjectiveAdjectivesToken _adjectiveadjectivestoken = (chalmersbot.Absyn.AdjectiveAdjectivesToken) foo;
       render("(");
       render("AdjectiveAdjectivesToken");
       sh(_adjectiveadjectivestoken.adjectivestoken_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.AdjectiveManyWrd)
    {
       chalmersbot.Absyn.AdjectiveManyWrd _adjectivemanywrd = (chalmersbot.Absyn.AdjectiveManyWrd) foo;
       render("(");
       render("AdjectiveManyWrd");
       sh(_adjectivemanywrd.manywrd_);
       render(")");
    }
  }

  private static void sh(chalmersbot.Absyn.ManyWrd foo)
  {
    if (foo instanceof chalmersbot.Absyn.ManyWord)
    {
       chalmersbot.Absyn.ManyWord _manyword = (chalmersbot.Absyn.ManyWord) foo;
       render("(");
       render("ManyWord");
       sh(_manyword.manytoken_);
       render(")");
    }
  }

  private static void sh(chalmersbot.Absyn.SpecialWordToken foo)
  {
    if (foo instanceof chalmersbot.Absyn.SpecialWordTokenSNounSToken)
    {
       chalmersbot.Absyn.SpecialWordTokenSNounSToken _specialwordtokensnounstoken = (chalmersbot.Absyn.SpecialWordTokenSNounSToken) foo;
       render("(");
       render("SpecialWordTokenSNounSToken");
       sh(_specialwordtokensnounstoken.snounstoken_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.SpecialWordTokenSNounEsToken)
    {
       chalmersbot.Absyn.SpecialWordTokenSNounEsToken _specialwordtokensnounestoken = (chalmersbot.Absyn.SpecialWordTokenSNounEsToken) foo;
       render("(");
       render("SpecialWordTokenSNounEsToken");
       sh(_specialwordtokensnounestoken.snounestoken_);
       render(")");
    }
  }

  private static void sh(chalmersbot.Absyn.NameRule foo)
  {
    if (foo instanceof chalmersbot.Absyn.NameRuleNameToken)
    {
       chalmersbot.Absyn.NameRuleNameToken _namerulenametoken = (chalmersbot.Absyn.NameRuleNameToken) foo;
       render("(");
       render("NameRuleNameToken");
       sh(_namerulenametoken.nametoken_);
       render(")");
    }
  }

  private static void sh(chalmersbot.Absyn.CodeRule foo)
  {
    if (foo instanceof chalmersbot.Absyn.CodeRuleCodeToken)
    {
       chalmersbot.Absyn.CodeRuleCodeToken _coderulecodetoken = (chalmersbot.Absyn.CodeRuleCodeToken) foo;
       render("(");
       render("CodeRuleCodeToken");
       sh(_coderulecodetoken.codetoken_);
       render(")");
    }
  }

  private static void sh(chalmersbot.Absyn.QWInW foo)
  {
    if (foo instanceof chalmersbot.Absyn.QWInWhich)
    {
       chalmersbot.Absyn.QWInWhich _qwinwhich = (chalmersbot.Absyn.QWInWhich) foo;
       render("(");
       render("QWInWhich");
       sh(_qwinwhich.inwrd_);
       sh(_qwinwhich.qwhichtoken_);
       render(")");
    }
  }

  private static void sh(chalmersbot.Absyn.QWHow foo)
  {
    if (foo instanceof chalmersbot.Absyn.QWHowMany)
    {
       chalmersbot.Absyn.QWHowMany _qwhowmany = (chalmersbot.Absyn.QWHowMany) foo;
       render("(");
       render("QWHowMany");
       sh(_qwhowmany.qhowtoken_);
       sh(_qwhowmany.manywrd_);
       render(")");
    }
  }

  private static void sh(chalmersbot.Absyn.QWord foo)
  {
    if (foo instanceof chalmersbot.Absyn.QWordQWordToken)
    {
       chalmersbot.Absyn.QWordQWordToken _qwordqwordtoken = (chalmersbot.Absyn.QWordQWordToken) foo;
       render("(");
       render("QWordQWordToken");
       sh(_qwordqwordtoken.qwordtoken_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.QWordQWhichToken)
    {
       chalmersbot.Absyn.QWordQWhichToken _qwordqwhichtoken = (chalmersbot.Absyn.QWordQWhichToken) foo;
       render("(");
       render("QWordQWhichToken");
       sh(_qwordqwhichtoken.qwhichtoken_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.QWordQHowToken)
    {
       chalmersbot.Absyn.QWordQHowToken _qwordqhowtoken = (chalmersbot.Absyn.QWordQHowToken) foo;
       render("(");
       render("QWordQHowToken");
       sh(_qwordqhowtoken.qhowtoken_);
       render(")");
    }
  }

  private static void sh(chalmersbot.Absyn.Subject foo)
  {
    if (foo instanceof chalmersbot.Absyn.SubjectToList)
    {
       chalmersbot.Absyn.SubjectToList _subjecttolist = (chalmersbot.Absyn.SubjectToList) foo;
       render("(");
       render("SubjectToList");
       sh(_subjecttolist.subjectlst_);
       render(")");
    }
  }

  private static void sh(chalmersbot.Absyn.SubjectLst foo)
  {
    if (foo instanceof chalmersbot.Absyn.SubjectList)
    {
       chalmersbot.Absyn.SubjectList _subjectlist = (chalmersbot.Absyn.SubjectList) foo;
       render("(");
       render("SubjectList");
       sh(_subjectlist.subjectlst_);
       sh(_subjectlist.subjectwrd_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.SubjectListElement)
    {
       chalmersbot.Absyn.SubjectListElement _subjectlistelement = (chalmersbot.Absyn.SubjectListElement) foo;
       render("(");
       render("SubjectListElement");
       sh(_subjectlistelement.subjectwrd_);
       render(")");
    }
  }

  private static void sh(chalmersbot.Absyn.SubjectWrd foo)
  {
    if (foo instanceof chalmersbot.Absyn.SubjectCode)
    {
       chalmersbot.Absyn.SubjectCode _subjectcode = (chalmersbot.Absyn.SubjectCode) foo;
       render("(");
       render("SubjectCode");
       sh(_subjectcode.coderule_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.SubjectBasic)
    {
       chalmersbot.Absyn.SubjectBasic _subjectbasic = (chalmersbot.Absyn.SubjectBasic) foo;
       render("(");
       render("SubjectBasic");
       sh(_subjectbasic.subjecttoken_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.SubjectSpecialWord)
    {
       chalmersbot.Absyn.SubjectSpecialWord _subjectspecialword = (chalmersbot.Absyn.SubjectSpecialWord) foo;
       render("(");
       render("SubjectSpecialWord");
       sh(_subjectspecialword.specialwordtoken_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.SubjectDeterminant)
    {
       chalmersbot.Absyn.SubjectDeterminant _subjectdeterminant = (chalmersbot.Absyn.SubjectDeterminant) foo;
       render("(");
       render("SubjectDeterminant");
       sh(_subjectdeterminant.determinanttoken_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.SubjectInWord)
    {
       chalmersbot.Absyn.SubjectInWord _subjectinword = (chalmersbot.Absyn.SubjectInWord) foo;
       render("(");
       render("SubjectInWord");
       sh(_subjectinword.inwrd_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.SubjectSmallWord)
    {
       chalmersbot.Absyn.SubjectSmallWord _subjectsmallword = (chalmersbot.Absyn.SubjectSmallWord) foo;
       render("(");
       render("SubjectSmallWord");
       sh(_subjectsmallword.smallwordtoken_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.SubjectPronoun)
    {
       chalmersbot.Absyn.SubjectPronoun _subjectpronoun = (chalmersbot.Absyn.SubjectPronoun) foo;
       render("(");
       render("SubjectPronoun");
       sh(_subjectpronoun.pronountoken_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.SubjectPeriod)
    {
       chalmersbot.Absyn.SubjectPeriod _subjectperiod = (chalmersbot.Absyn.SubjectPeriod) foo;
       render("(");
       render("SubjectPeriod");
       sh(_subjectperiod.periodtoken_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.SubjectPeriodNr)
    {
       chalmersbot.Absyn.SubjectPeriodNr _subjectperiodnr = (chalmersbot.Absyn.SubjectPeriodNr) foo;
       render("(");
       render("SubjectPeriodNr");
       sh(_subjectperiodnr.periodtoken_);
       sh(_subjectperiodnr.numberrule_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.SubjectName)
    {
       chalmersbot.Absyn.SubjectName _subjectname = (chalmersbot.Absyn.SubjectName) foo;
       render("(");
       render("SubjectName");
       sh(_subjectname.namerule_);
       render(")");
    }
  }

  private static void sh(chalmersbot.Absyn.Rest foo)
  {
    if (foo instanceof chalmersbot.Absyn.RestList)
    {
       chalmersbot.Absyn.RestList _restlist = (chalmersbot.Absyn.RestList) foo;
       render("(");
       render("RestList");
       sh(_restlist.rest_1);
       sh(_restlist.rest_2);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.RestIdent)
    {
       chalmersbot.Absyn.RestIdent _restident = (chalmersbot.Absyn.RestIdent) foo;
       render("(");
       render("RestIdent");
       sh(_restident.ident_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.RestVerb)
    {
       chalmersbot.Absyn.RestVerb _restverb = (chalmersbot.Absyn.RestVerb) foo;
       render("(");
       render("RestVerb");
       sh(_restverb.verb_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.RestPreposition)
    {
       chalmersbot.Absyn.RestPreposition _restpreposition = (chalmersbot.Absyn.RestPreposition) foo;
       render("(");
       render("RestPreposition");
       sh(_restpreposition.prepositiontoken_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.RestSubject)
    {
       chalmersbot.Absyn.RestSubject _restsubject = (chalmersbot.Absyn.RestSubject) foo;
       render("(");
       render("RestSubject");
       sh(_restsubject.subject_);
       render(")");
    }
    if (foo instanceof chalmersbot.Absyn.RestAdjective)
    {
       chalmersbot.Absyn.RestAdjective _restadjective = (chalmersbot.Absyn.RestAdjective) foo;
       render("(");
       render("RestAdjective");
       sh(_restadjective.adjective_);
       render(")");
    }
  }


  private static void pp(Integer n, int _i_) { buf_.append(n); buf_.append(" "); }
  private static void pp(Double d, int _i_) { buf_.append(d); buf_.append(" "); }
  private static void pp(String s, int _i_) { buf_.append(s); buf_.append(" "); }
  private static void pp(Character c, int _i_) { buf_.append("'" + c.toString() + "'"); buf_.append(" "); }
  private static void sh(Integer n) { render(n.toString()); }
  private static void sh(Double d) { render(d.toString()); }
  private static void sh(Character c) { render(c.toString()); }
  private static void sh(String s) { printQuoted(s); }
  private static void printQuoted(String s) { render("\"" + s + "\""); }
  private static void indent()
  {
    int n = _n_;
    while (n > 0)
    {
      buf_.append(" ");
      n--;
    }
  }
  private static void backup()
  {
   String s = buf_.toString();

     if (s.substring(buf_.length() - 1, buf_.length()).equals(" ")) {
       buf_.setCharAt(buf_.length() - 1, '\"');
       buf_.setLength(buf_.length() - 1);
     }
  }
  private static void trim()
  {
     while (buf_.length() > 0 && buf_.charAt(0) == ' ')
        buf_.deleteCharAt(0); 
    while (buf_.length() > 0 && buf_.charAt(buf_.length()-1) == ' ')
        buf_.deleteCharAt(buf_.length()-1);
  }
  private static int _n_ = 0;
  private static StringBuilder buf_ = new StringBuilder(INITIAL_BUFFER_SIZE);
}

